<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center feedback_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub feedback_fd0_0'>
				<view class='flex flex-wrap align-center feedback_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
					data-url="1">
					<text class='fu-iconfont2  feedback_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<text class='feedback_fd0_0_c1'>我要反馈</text>
				<view class='flex flex-wrap align-center feedback_fd0_0_c2'>
					
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#1593FF"></u-loading>
			<view>加载中</view>
		</view>
		<template v-else>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch feedback_flex_1">
				<text class='feedback_fd1_0'>反馈类型</text>
				<benben-select-diy ref="showSelectPopup1658997388607"
					class-name='flex flex-wrap align-center flex feedback_fd1_1' :items.sync="dataList.types"
					v-model="feedback_id" default-type="id" default-label="title" :allow-cancel='false' type="radio"
					:disabled='false'>
					<template v-for='(item,key0) in dataList.types'>
						<view v-if="item.isSelected" class='flex align-center justify-center flex feedback_fd1_1_c0'
							:key="key0" @tap="$refs.showSelectPopup1658997388607.tapHandle(key0)">
							<text class='feedback_fd1_1_c0_c0'>{{item.title}}</text>
						</view>
						<view v-else class='flex align-center justify-center flex feedback_fd1_1_c1' :key="key0"
							@tap="$refs.showSelectPopup1658997388607.tapHandle(key0)">
							<text class='feedback_fd1_1_c1_c0'>{{item.title}}</text>
						</view>
					</template>
				</benben-select-diy>
				<view class='flex flex-wrap align-center feedback_fd1_2'>
				</view>
			</view>
			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedback_flex_2">
				<text class='feedback_fd2_0'>反馈内容</text>
				<view class='flex flex-wrap feedback_fd2_1'>
					<textarea class='flex feedback_input_fd2_1' confirm-type="done" :placeholder="'问题描述的越详细，有助于我们更快的解决问题'"
						:maxlength="240" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx" v-model="body" />
			
				</view>
				<benben-images-upload ref="benbenImagesUploadfd2_2" :img-list.sync="thumb" :img-ids.sync="thumbId"
					:is-show-tips='true' :maxlength="6">
					<template v-slot="{ num, maxlength, isShow, imgList }">
						<view class="flex flex-wrap align-stretch flex feedback_fd2_2">
			
							<view v-for="(image, index) in imgList" :key="index"
								class='flex position-relative feedback_fd2_20'>
								<text class='fu-iconfont2 position-absolute feedback_fd2_200'
									@tap.stop="$refs.benbenImagesUploadfd2_2.delImage(index)">&#xE8E7;</text>
								<image class='feedback_fd2_201' mode="aspectFill"
									@tap.stop="$refs.benbenImagesUploadfd2_2.previewImage(index)" :src='image'></image>
							</view>
			
							<image class='feedback_fd2_21' @tap.stop="$refs.benbenImagesUploadfd2_2.manyChooseImage()"
								v-if="isShow" mode="aspectFill" :src='"https://app.ezsdcsm.com/images/59.png"'></image>
							<text class='image_upload_tips feedback_fd2_22'>请上传应用截图，最多上传{{maxlength}}张</text>
						</view>
					</template>
				</benben-images-upload>
			</view>
			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedback_flex_3">
				<text class='feedback_fd3_0'>请留下您的联系方式</text>
				<input class='feedback_fd3_1' type="text" placeholder="手机号/邮箱/QQ号" confirm-type="done" :maxlength="11"
					placeholder-style="color:#9C9C9C;font-size:28rpx" v-model="contact" />
			</view>
			<!---flex布局flex布局结束-->
			<view class="flex align-center justify-between feedback_flex_4">
				<view class='feedback_fd4_1' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/my/historicalFeedback/historicalFeedback`">反馈记录</view>
				<view class='feedback_fd4_0' @tap.stop="getsubmit()">提交</view>
			
			</view>
			<view :style="{height: '138rpx'}"></view>
		</template>
		
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"feedback_id": "1",
				"dataList": {
					"contact_status": "",
					"thumb_status": "",
					"qq_status": "",
					"email_status": "",
					"is_must_qq": "",
					"is_must_email": "",
					"is_must_phone": "",
					"types": []
				},
				"body": "",
				"thumb": [],
				"contact": "",
				"thumbId": "",
				"is_submit": false,
				"isShow": true,
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.getdataList()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取投诉类型
			async getdataList() {
				//请求方法
				//数据验证

				let dataListData = await this.$api.post(global.apiUrls.post5d63ba953ee01, {

				});
				this.isShow = false;
				if (dataListData.data.code != 1) {
					this.$message.info(dataListData.data.msg);
					return
				}
				let dataListinfo = dataListData.data;
				this.dataList = dataListinfo.data;
				this.feedback_id = this.dataList.types[0].id;
				// console.log(this.dataList);
			},
			//提交意见反馈
			async getsubmit() {
				if (this.is_submit) return;
				
				//请求方法
				//数据验证
				if (!this.body) {
					this.$message.info('请输入反馈内容');
					return;
				}
				if (!this.contact) {
					this.$message.info('请填写联系方式');
					return;
				}
				this.is_submit = true;
				let gniData = await this.$api.post(global.apiUrls.post6309bede99775, {
					body: this.body,
					thumb: this.thumb.length > 0 ? this.thumb.join(',') : '',
					contact: this.contact,
					operationsuggestionstype_id: this.feedback_id
				});
				if (gniData.data.code != 1) {
					this.is_submit = false;
					this.$message.info(gniData.data.msg);
					return
				}
				let gniinfo = gniData.data;
				this.$message.info(gniData.data.msg);
				setTimeout(() => {
					this.is_submit = false;
					uni.navigateBack();
				}, 800)
				// this.$urouter.redirectTo(`/pages/my/historicalFeedback/historicalFeedback`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.feedback_fd4_0 {
		background: #2C8FFF;
		width: 442rpx;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
	}
	.feedback_fd4_1 {
		border: 1px solid #1593FF;
		width: 220rpx;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #1593FF;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
	}

	.feedback_flex_4 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		position: fixed;
		z-index: 10;
		bottom: calc(48rpx + var(--window-bottom));
	}

	.feedback_fd3_0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #1A1A1A;
		line-height: 45rpx;
		margin: 40rpx 0rpx 32rpx 0rpx;
	}

	.feedback_fd3_1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.feedback_flex_3 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		background-size: 100% auto !important;
		margin: 0rpx 24rpx 0rpx 24rpx;
	}

	.feedback_fd2_0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #1A1A1A;
		margin: 32rpx 0rpx 0rpx 0rpx;
		line-height: 45rpx;
	}

	.feedback_fd2_1 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.feedback_input_fd2_1 {
		width: 100%;
		height: 134rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.feedback_fd2_2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.feedback_fd2_20 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedback_fd2_200 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.feedback_fd2_201 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedback_fd2_21 {
		width: 160rpx;
		height: 160rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedback_fd2_22 {
		font-size: 24rpx;
		color: #BFBFBF;
		font-weight: 400;
		width: 100%;
		line-height: 33rpx;
	}

	.feedback_flex_2 {
		background: #fff;
		background-size: 100% !important;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.feedback_fd1_0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #1A1A1A;
		line-height: 45rpx;
		margin: 32rpx 32rpx 24rpx 32rpx;
	}

	::v-deep .feedback_fd1_1 {
		padding: 0rpx 16rpx 0rpx 16rpx;
	}

	.feedback_fd1_1_c0 {
		background: #2C8FFF;
		background-size: 100% !important;
		// height: 64rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		// width: 206rpx;
		margin: 0rpx 16rpx 24rpx 16rpx;
		padding: 16rpx;
	}

	.feedback_fd1_1_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #fff;
		line-height: 40rpx;
	}

	.feedback_fd1_1_c1 {
		background: rgba(246, 247, 249, 1);
		background-size: 100% !important;
		// height: 64rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		// width: 206rpx;
		margin: 0rpx 16rpx 24rpx 16rpx;
		padding: 16rpx;
	}

	.feedback_fd1_1_c1_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		line-height: 62rpx;
	}

	.feedback_fd1_2 {
		background: rgba(248, 248, 248, 1);
		background-size: 100% !important;
		height: 20rpx;
		background-size: 100% auto !important;
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.feedback_flex_1 {
		background: #fff;
		background-size: 100% !important;
	}

	.feedback_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.feedback_fd0_0_c0 {
		width: 135rpx;
		height: 45rpx;
	}

	.feedback_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 36rpx;
	}

	.feedback_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.feedback_fd0_0_c2 {
		width: 135rpx;
		height: 45rpx;
	}

	.feedback_fd0_0_c2_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.feedback_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto !important;
	}
</style>
